<template>
  <input
    class="input"
    :type="type"
    :maxlength="maxLength"
    :value="modelValue"
    @input="inputChange"
  />
</template>

<script>
export default {
  behaviors: ["uni://form-field"],
  props: {
    type: {
      type: String,
      default: "text",
    },
    maxLength: {
      type: Number,
      default: 140,
    },
    modelValue: {
      type: [String, Number],
      default: "",
    },
    obj: String
  },
  created() {
    
  },
  methods: {
    inputChange(e) {
      // this.$emit("update:modelValue", e.target.value);
      this.$emit("updateModelValue", this.obj, e.target.value);
    },

  },
};
</script>

<style lang="less" scoped>
	@my-color-primary:#aa69ff;
.input {
  border: 1px solid @my-color-primary;
  border-radius: 0.5rem;
  height: 2rem;
  padding-left: 0.8rem;
}
</style>